# orginSentenceFilePath='D:\pydataset\CCIRCup\CCIRCup.test.Sentence'
# decodeSentenceFilePath='D:\ProgramFiles\pythonworkplace\LGN\data\CCIRCupdecode.Sentence'
# outfile='D:\ProgramFiles\pythonworkplace\LGN\data\CCIRCup.SentenceComparison'

orginSentenceFilePath='D:\pydataset\PeopleDaily\PeopleDaily.test.Sentence'
decodeSentenceFilePath='D:\ProgramFiles\pythonworkplace\LGN\data\peopledecode.Sentence'
outfile='D:\ProgramFiles\pythonworkplace\LGN\data\people.SentenceComparison'

with open(orginSentenceFilePath,mode='r',encoding='utf8') as orginSentenceFile:
    with open(decodeSentenceFilePath, mode='r', encoding='utf8') as decodeSentenceFile:
        with open(outfile, mode='w', encoding='utf8') as outfile:
            orginline = orginSentenceFile.readline()
            decodeline = decodeSentenceFile.readline()
            max=0
            while orginline:
                orginlist = orginline.strip().split(',')
                decodelist = decodeline.strip().split(',')
                if orginlist[1]==decodelist[1]:
                    orginline = orginSentenceFile.readline()
                    decodeline = decodeSentenceFile.readline()
                else:
                    if len(orginlist[1])>max:
                        max=len(orginlist[1])
                    outfile.write('orgin,'+str(len(orginlist[1]))+','+orginlist[0]+','+orginlist[1]+','+decodelist[0]+'\n')
                    orginline = orginSentenceFile.readline()
            while decodeline:
                decodelist = decodeline.strip().split(',')
                outfile.write(',,,decode,'+str(len(decodelist[1]))+','+decodelist[0] + ',' + decodelist[1]+'\n')
                decodeline = decodeSentenceFile.readline()
            print(max) #250,猜测大于250长度的句子会被舍去




